<?php

namespace AppVue\Http\Controllers\Api;

use AppVue\Http\Models\ResponseResult;
use Auth;
use AppVue\Http\Controllers\Controller;
use Illuminate\Http\Request;

class UserApiController extends Controller
{
    public function __construct()
    {
        $this->middleware([
            'EncryptCookies',
            'AddQueuedCookiesToResponse',
            'StartSession',
            'ShareErrorsFromSession',
            'VerifyCsrfToken',
            'SubstituteBindings'
        ]);
    }

    public function userInfo()
    {
        if  (Auth::check()) {
            return ResponseResult::success(Auth::user());
        }else {
            return ResponseResult::error(50000, 'Not Login');
        }
    }

    public function register(Request $request)
    {
        dd($request->all());
    }
}
